(function(){
    Ext.onReady(function(){
        Ext.define('Person',{
        	extend: 'Ext.data.Model',
        	fields: [
        		{name: 'name', type: 'auto'},
        		{name: 'age', type: 'int'},
        		{name: 'email', type: 'auto'}
        	]
        });
        Ext.regModel("user",{
    	fields: [
        		{name: 'name', type: 'auto'},
        		{name: 'age', type: 'int'},
        		{name: 'email', type: 'auto'}
        	]
	    });
        // method 1, create using Ext.create (recommended)
	    var p = Ext.create('Person', {
	    	name: 'pfuuve3.com',
	    	age: 26,
	    	email: 'fuuve3com@163.com'
	    });
	    //alert(p.get('name')+'<br/>'+p.get('age')+'<br/>'+p.get('email'));
        // method 3, create on the type directly
	    var p1 = new Person({
    		name: 'p1fuuve3.com',
	    	age: 27,
	    	email: 'fuuve3com@163.com'
    	});
    	alert(p1.get('name')+'<br/>'+p1.get('age')+'<br/>'+p1.get('email'));

        // method 2, create through the manager (deprecated)
    	var p2 = Ext.ModelManager.create({
		    name: 'p2fuuve3.com',
	    	age: 28,
	    	email: 'fuuve3com@163.com'
		}, 'Person');
		//alert(p2.get('name')+'<br/>'+p2.get('age')+'<br/>'+p2.get('email'));
	    });
})();